<!DOCTYPE html>

<html>

<head>
    <title></title>
    <script src='../vue.js'></script>
</head>

<body>
    <div id="app-3">

        <!-- 
        .enter
        .tab
        .delete (捕获 “删除” 和 “退格” 键)
        .esc
        .space
        .up
        .down
        .left
        .right 
    -->

        <!-- 只有在 keyCode 是 13 时调用 vm.submit() -->
        <input v-on:keyup.13="submit" value="enter">
        <!-- 缩写语法 -->
        <input @keyup.enter="submit" value="enter">
        <!-- 使用自定义键值 -->
        <input @keyup.112="submit" value="f1">

    <!-- 
        .ctrl
        .alt
        .shift
        .meta 
    -->
        <!-- Alt + C -->
        <input @keyup.alt.67="submit" value="Alt + C">
        <!-- Ctrl + Click -->
        <div @click.ctrl="submit">Ctrl + Click</div>
    
        
    <!-- 
        .left
        .right
        .middle 
    -->
        <!-- leftClick -->
        <div @click.left="submit">left Click</div>
        <!-- leftClick -->
        <div @click="submit">Click</div>


    </div>
    <script>
        // 可以使用 v-on:keyup.f1
        Vue.config.keyCodes.f1 = 112;
        var app3 = new Vue({
            el: '#app-3',
            methods: {
                submit: function (event) {
                    alert('submit method');
                }
            }
        });
    </script>
</body>


</html>